﻿@model PagedList.IPagedList<ThesisSystem.Models.Marking>
@{
    var targetsSearch = ViewBag.Current as ThesisSystem.ViewModels.TargetsSearch;
}
    @{
    Layout = null;
}

    <!DOCTYPE html>

    <html>
    <head>
        <title>评卷检索</title>

<link href="../../Content/CSS/searchstyle.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <div class="Search_thesis">
            <h3>
                评卷检索</h3>
            @*查询条件*@
            <div class="sch_areas" align="center">
                @using (Html.BeginForm())
            {
                    <div id="Summary" style="float: left; width: 43%; overflow: hidden; margin: 2px">
                        <span>评卷名：</span> @Html.TextBox("Title", targetsSearch.Title as string)
                    </div>
                    <div id="studyProfessional" style="float: left; width: 38%; overflow: hidden; margin: 2px">
                        <span>评类型：</span> @Html.DropDownList("TypeID" ,string.Empty)
                    </div>
                    <br />
                    
                    <p align="center" style="height: 28px; border: 1px solid #c3e1c9; margin: 2px; padding: 1px;
                        clear: left">
                        <input type="submit" value="检索" id="Searchbtn" />
                        <input type="reset" value="重置" id="Searchreset" />
                    </p>

          }
            </div>
            @* 查询列表*@
            <div class="sch_area">
                <table width="100%" class="lst_tbl" cellspacing="1px">
                    <tr>
                        <th align="center" class="crd_th" width="23%">
                            评卷名
                        </th>
                        <th align="center" class="crd_th" width="9%">
                            评卷类型
                        </th>
                        <th align="center" class="crd_th" width="15%">
                            操作
                        </th>
                    </tr>
                    @foreach (var item in Model)
            {
                        <tr>
                            <td class="crd_td">
                                @Html.DisplayFor(modelItem => item.Title)
                            </td>
                            <td class="crd_td">
                           
                                @Html.DisplayFor(modelItem =>item.MarkType)
                           
                                
                            </td>
                            <td class="crd_td">
                                @Html.ActionLink("查看", "Details", new { id=item.MarkingID}, new { id = "LockD" })
                                @Html.ActionLink("编辑", "Edit", new { id = item.MarkingID }, new { id = "Edit" })
                                @Html.ActionLink("删除", "Delete", new { id = item.MarkingID }, new { id = "Delete" })
                            </td>
                        </tr>
            }
                </table>
            </div>
            <div class="sch_area">
                <p align="left" style="height: 30px; border: 1px solid #c3e1c9; margin: 1px; padding: 1px;
                    clear: left">
                    @*分页部分*@
                    @if (Model.PageCount > 1)
                {

                    if (Model.IsFirstPage)
                    {
                        ////当为第一页时，下一页为空链接
                        @:<a>首页</a> @Html.Encode("-")
                           @:<a>上一页</a>
                    }
                    else
                    {
                        @Html.ActionLink("首页", "Search", new { id = Request.QueryString["id"], page = 1, Current = ViewBag.Current })@Html.Encode("-")
                        @Html.ActionLink("上一页", "Search", new { id = Request.QueryString["id"], page = Model.PageIndex, Current = ViewBag.Current })
                    }
                        @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)  @:/ @(Model.PageCount)
                    if (Model.IsLastPage)
                    {
                        //当为最后一页时，下一页为空链接
                
                        @:<a>下一页</a>@Html.Encode("-")
                       @:<a>尾页</a>
                    }
                    else
                    {

                //PageIndex为索引值，初始值为0，值为page-1。上一页为PageIndex,下一页为 PageIndex+2
                        @Html.ActionLink("下一页", "Search", new { id = Request.QueryString["id"], page = Model.PageIndex + 2, Current = ViewBag.Current }) @Html.Encode("-")
                
                        @Html.ActionLink("尾页", "Search", new { id = Request.QueryString["id"], page = Model.PageCount, Current = ViewBag.Current })
                      }
               }
                </p>
            </div>
        </table>
            @Content.Script("jquery-min.js", Url) 
            @Content.Script("jquery-ui-min.js", Url)
            <script type="text/javascript">
                $(document).ready(function () {
                    $("#Searchbtn").button();
                    $("#Searchreset").button();
                    $("#Back").button();
                });
            </script>
        </div>

    
   
    </body>
    </html>
